-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize counter initialization by reducing the number of bulk counter poll calls and communication between swss/sairedis #1527
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -2618,6 +2819,171 @@ | |||
notifyPoll(); | |||
} | |||
|
|||
void FlexCounter::bulkAddCounter( |
Check notice
Code scanning / CodeQL
Irregular enum initialization Note
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
d2a613b
to
ad06ae8
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
the failure is not relevant to the commits
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
11034f3
to
fe9a9be
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
All counters are created in bulk mode. We should translate bulkAddObject to iteration of single call (addObject) for counter groups that do not support bulk. Signed-off-by: Stephen Sun <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Stephen Sun <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @kcudnik would you please review it again and merge it if no comments? fix an issue since last approval and also add ut to cover it. |
Optimize counter initialization by reducing the number of bulk counter poll calls and communication between swss(orchagent)/sairedis(syncd) during initialization.
Originally,
orchagent
notifiessyncd
to initialize the counter using an extended sairedis callSAI_REDIS_SWITCH_ATTR_FLEX_COUNTER
for each SAI object with the object ID as the key, which means the number of the extended sairedis calls is identical as the number of objects. It takes time to finish all the extended sairedis calls.Now, for counter groups that have many objects (e.g., port, PG, queues, etc),
orchagent
notifiessyncd
to initialize the counter using a single extend sairedis call with many objects' ID as the key (format:<key1>,<key2>,...<keyn>
). So, it takes much less time to initialize the counters because fewer extend sairedis calls are required.Details:
In sairedis, the bulk counter is supported for all counter groups except
Buffer Pool Counter
andDASH ENI counter
.In swss, bulk counter for the following counter groups
HLD sonic-net/SONiC#1862